package com.randi.monitor.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Transient;

import java.util.Date;

/**
 * @author ziye
 */
@Data
@ApiModel(value = "SysUserOnline", description = "SysUserOnline对象")
public class SysUserOnline {

    @ApiModelProperty(value = "会话编号")
    private String tokenId;

    @ApiModelProperty(value = "用户名称")
    private String userName;

    @ApiModelProperty(value = "登录IP地址")
    private String ipAddress;

    @ApiModelProperty(value = "登录地址")
    private String loginLocation;

    @ApiModelProperty(value = "浏览器类型")
    private String browser;

    @ApiModelProperty(value = "操作系统")
    private String os;

    @ApiModelProperty(value = "登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date loginTime;

    @ApiModelProperty(value = "操作禁用")
    private Boolean allowDisable;

    @Transient
    public String getKey() {
        return this.tokenId;
    }

}
